<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFrameworks>$(NetCoreAppToolCurrent);$(NetFrameworkToolCurrent)</TargetFrameworks>
    <NoWarn>$(NoWarn),CA1050,CA1850,CA1845,CA1859;CA1866,NU5128</NoWarn>
    <RootNamespace>Microsoft.NET.Sdk.WebAssembly</RootNamespace>
    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <NoWarn>$(NoWarn);CS8632</NoWarn>
  </PropertyGroup>

  <ItemDefinitionGroup>
    <PackageReference>
      <PrivateAssets>All</PrivateAssets>
      <Publish>true</Publish>
    </PackageReference>
  </ItemDefinitionGroup>

  <ItemGroup>
    <Compile Include="..\Common\Utils.cs" />
    <Compile Include="..\WasmAppBuilder\WebcilConverter.cs" />
    <Compile Include="..\WasmAppBuilder\LogAdapter.cs" />

    <PackageReference Include="Microsoft.Build" Version="$(MicrosoftBuildVersion)" />
    <PackageReference Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildFrameworkVersion)" ExcludeAssets="runtime" />
    <PackageReference Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildUtilitiesCoreVersion)" ExcludeAssets="runtime" />

    <ProjectReference Include="..\Microsoft.NET.WebAssembly.Webcil\Microsoft.NET.WebAssembly.Webcil.csproj" />
  </ItemGroup>

  <Target Name="GetFilesToPackage" Returns="@(FilesToPackage)">
    <ItemGroup>
      <_PublishFramework Remove="@(_PublishFramework)" />
      <_PublishFramework Include="$(TargetFrameworks)" />

      <FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\*.dll" TargetPath="tools\%(_PublishFramework.Identity)" />
      <FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\*.pdb" TargetPath="tools\%(_PublishFramework.Identity)" />
    </ItemGroup>
  </Target>
</Project>
